/* eslint-disable */
import { request } from '@umijs/max';
import { MENU_CODES, METHOD_TYPE, MODULES } from '@/options';
import { Result } from '@/types/common/request';
import useBaseRequest from '@/hooks/useBaseRequest';

type DataType = USER_TYPE.Info;
type Params = USER_TYPE.Params;
const ApiUrl = `/${MODULES.SYSTEM}/${MENU_CODES.USER}`;

export const { getList, addItem, updateItem, delItem, detailItem } = useBaseRequest<
  DataType,
  Params
>(ApiUrl);

/** 获取用户详细信息 */
export async function getUserInfo(options?: { [key: string]: any }) {
  return request<Result<USER_TYPE.UserInfoRet>>(ApiUrl + '/info', {
    method: METHOD_TYPE.POST,
    ...(options || {}),
  });
}
